<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>AFC设备维修系统</title>
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/common.css" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/tag.css" />
		<link href="<%=path%>/js/My97DatePicker/skin/WdatePicker.css"
			rel="stylesheet" type="text/css" />
		<link type="text/css" rel="stylesheet" href="<%=path%>/css/zTreeStyle/zTreeStyle.css" />	
		<link type="text/css" href="<%=path%>/js/jquery-ui-1.8.21.custom/css/smoothness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="<%=path%>/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="<%=path%>/js/common.js"></script>
		<script type="text/javascript" src="<%=path%>/js/jquery.ztree.core-3.1.js"></script>
		<script type="text/javascript" src="<%=path%>/js/jquery.ztree.excheck-3.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/js/jquery.ztree.exedit-3.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/js/form.js"></script>
		<script type="text/javascript" src="<%=path%>/js/jquery-ui-1.8.21.custom/js/jquery-ui-1.8.21.custom.min.js">
		<script type="text/javascript" src="<%=path%>/js/public.js"></script>
		</script>
		<script type="text/javascript">
			$(function() {
				//头部点击高亮页面显示
				$("#top_nav li").click(function() {
					//获取导航信息 
					var item =$.trim($(this).attr("id"));
					//session 赋值哇  要了老命鸟  add gaoxuejiao
					var url = encodeURI(encodeURI('doTopSessionAtrr.action?liID=' + item));
					$.ajax( {
						url : url,
						type : "POST",
						cache : false,
						success : function(message) {
						}
					});
					
					//當前對象下所有 ul
					
					var topTempUL ="ul_"+item;
					var uID="#"+topTempUL+" li";
						$(uID).each(function(j){
							if(j==0){
								$(uID).attr("class", "");
								$(uID).css("color", "#FFFFFF");
								$(this).attr("class", "focus");
								$(this).css("color", "#000000");
							}
						});
					//获取导航信息 
					var item =$.trim($(this).attr("id"));
					
					//session 赋值哇  要了老命鸟  add gaoxuejiao
					var url = encodeURI(encodeURI('doNavSessionAtrr.action?navID=' + item));
					$.ajax( {
						url : url,
						type : "POST",
						cache : false,
						success : function(message) {
						}
					});
					
				});
				var count =0;
				var topNavID="";
				$("#top_nav li").each(function(i){
					var liID = $(this).attr("id");
					count =count+1;
					//设置头部加载高亮
					var inputValue =<%= session.getAttribute("liID") %>;
					//当前li id
					
					if(null != inputValue && null != liID){
						if($.trim(inputValue) == $.trim(liID)){
							$("#top_nav li").attr("class", "");
							$("#top_nav li").children("a").css("color", "#000000");
							$(this).attr("class", "focus");
							$(this).children("a").css("color", "#fe7c0a");
							
							var sessionVal='';
							//更新二级标题
							$(".nav ul").each(function(i){
								var tempUL ="ul_"+$.trim(inputValue);
								if($(this).attr("id")==tempUL){
									$(".nav ul").hide();
									$(this).show();
									
									//遍历对应二级节点
									$("#"+tempUL+" li").each(function(i){
										if(i==0){
											sessionVal=$(this).attr("id");
										}
									});
								}
							});
						}
					}else{
						if(i==0){
							$("#top_nav li").attr("class", "");
							$("#top_nav li").children("a").css("color", "#000000");
							$(this).attr("class", "focus");
							$(this).children("a").css("color", "#fe7c0a");
							
							//获取默认liid  设置默认值
							var topID = $("#top_nav li").attr("id");
							var url = encodeURI(encodeURI('doTopSessionAtrr.action?liID=' + topID));
							$.ajax( {
								url : url,
								type : "POST",
								cache : false,
								success : function(message) {
								}
							});
						}
					}
				});
				if(count ==1){
					$("#top_nav li").css("margin-left", "145px");
				}
			});
	</script>
	</head>
	<body>
		<!-- 顶栏start -->
		<div id="bar">
			<ul>
				<li class="city">
					<span class="city_switch">当前城市</span>
					${logUser.cityName}
					&nbsp;&nbsp;&nbsp;
					<!--  <a href="<s:text name='10086.url'/>" style="text-decoration: underline" target="_blank">10086主动群发短信监控</a>-->
				</li>
				<li class="exit">
					<a href="logout.action" style="text-decoration: underline">退出</a>
				</li>
				<li class="login_info">欢迎您，
				<span class="login_name">${logUser.userName}</span> &nbsp;${logUser.roleName}！</li>
			</ul>
		</div>
		<!-- 顶栏end -->

		<!-- 顶部start -->
		<div id="top"> 
			<div class="body">
				<div class="logo"></div>
				<ul id="top_nav">
					<s:iterator value="#session.logUser.purviewList" id="clist" status="index">
						<s:if test="#clist.parentId ==-1 ">
							<s:if test="#index.first">
								<li id="${clist.id}" class="focus">
									<a href="${clist.actionUrl}" style="color: #fe7c0a">${clist.actionName}</a>
								</li>
							</s:if>
							<s:else>
								<li id="${clist.id}"><a href="${clist.actionUrl}" >${clist.actionName}</a></li>
							</s:else>
						</s:if>
					</s:iterator>
					
					<!--  <li class="focus"><a href="contractlist.action" style=" color:#fe7c0a;">传播管理</a></li>-->
					
				</ul>
			</div>
		</div>
		<!-- 顶部end -->
	</body>

</html>
